<template>
	<view class="main">
		<u-navbar :is-back="true" title="消息通知" :background="background" border-bottom="false" back-icon-color="#000000" title-color="#33312D"
			title-bold="true"></u-navbar>

		<view class="content" v-for="(item,index) in noticelist" :key="index" v-if="item.type==0">
			<view class="titles">
				退款通知
			</view>
			<view class="tit">
				<text>退款金额</text>
				<view class="money">
					¥{{item.refund_money}}
				</view>
			</view>
			<view class="mid">
				<text>商品名称</text>
				<view>
					{{item.goodinfo[0].name}}
				</view>
			</view>
			<view class="mid">
				<text>退款原因</text>
				<view>
					{{item.reason}}
				</view>
			</view>
			<view class="mid">
				<text>订单号</text>
				<view>
					{{item.refund_orderno}}
				</view>
			</view>
			<view class="mid">
				<text>退款时间</text>
				<view>
					{{formatTime(item.create_time,'YYYY-MM-DD')}}
				</view>
			</view>
		</view>
		<view class="content" v-for="(item,index) in noticelist" :key="index" v-if="item.type==1">
			<view class="titles">
				新订单通知
			</view>
			<view class="tit">
				<text>金额</text>
				<view class="money">
					¥{{item.pay_true}}
				</view>
			</view>
			<view class="mid">
				<text>商品名称</text>
				<view>
					{{item.goodinfo[0].name}}
				</view>
			</view>
			<view class="mid">
				<text>商品规格</text>
				<view>
					{{item.goodinfo[0].specs}}
				</view>
			</view>
			<view class="mid">
				<text>订单号</text>
				<view>
					{{item.orderno}}
				</view>
			</view>
			<view class="mid">
				<text>购买时间</text>
				<view>
					{{formatTime(item.pay_time,'YYYY-MM-DD')}}
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				background: {
					backgroundColor: '#fff'
				},
noticelist:[]
			}
		},
		onLoad() {
this.getlist()

		},
		mounted() {

		},
		onShow() {},
		methods: {
			getlist(){
				global.$http.request({
					url:'/shopapi/user/notify',
					data:{
						token:uni.getStorageSync('token')
					}
				}).then(res=>{
					console.log(res.data.data);
					this.noticelist=res.data.data
				})
			},

		}
	}
</script>
<style lang="scss">
	page {
		font-family: Source Han Sans CN;
		width: 750rpx;
		margin: 0 auto;
		background-color: #f7f7f7;

		.main {
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 750rpx;
			margin: 0 auto;

			.content {
				background-color: #fff;
				width: 750rpx;
				padding: 30rpx 36rpx;
				margin-bottom: 10rpx;

				.titles {
					font-size: 30rpx;
					font-weight: 400;
					text-align: left;
					color: #000000;
				}

				.tit {
					text-align: center;
					padding-bottom: 20rpx;

					text {
						font-size: 24rpx;
						font-weight: 400;
						color: #808080;
					}

					view {
						padding-top: 12rpx;
						font-size: 42rpx;
						font-weight: 400;
						color: #000000;
					}
				}

				.mid {
					padding: 15rpx 0;
					display: flex;

					text {
						width: 150rpx;
						font-size: 24rpx;
						font-weight: 400;
						color: #808080;
						
line-height: 29rpx;
					}

					view {
						width: 500rpx;
						font-size: 24rpx;
						font-weight: 400;
						color: #000000;
						line-height: 29rpx;
					}
				}
			}
		}
	}
</style>
